menu binding: emit submenu close after activate
authorRyan Lortie <desrt@desrt.ca>
Mon, 16 Jun 2014 18:26:21 +0000 (14:26 -0400)
committerRyan Lortie <desrt@desrt.ca>
Mon, 16 Jun 2014 19:34:42 +0000 (15:34 -0400)
commitb532e1ff0ab25303c838565220e8d41fb3044a05
tree37b47b6bbdd10b3facf4011779f00798714ac5c1
parent38a6a72a7fe3442445a0e204977c42a196e2402a
menu binding: emit submenu close after activate

We want to make sure that the submenu action is changed back to FALSE
_after_ the menu item has been activated.  This prevents the menu
teardown handler from deleting the menu item before it can be activated.

Unfortunately, GtkMenuShell emits "hide" before the item activation.
This is probably done to prevent the application from doing things like
showing dialogs when the menu is still holding the grab.

In the case where we are doing an activate, set a boolean flag on each
of the open menus (following the parent stack) indicating that we'll be
emitting another signal soon (selection done).  If that flag is set, we
defer the setting of the submenu action until we receive the second
signal.

https://bugzilla.gnome.org/show_bug.cgi?id=729820
gtk/gtkmenushell.c
gtk/gtkmenushellprivate.h